package comvecspace.data.model.sql;

public class SqlParamPlaceholder {
	private int currIndex = 0;
	private boolean jpaStyle = true;
	
	/**
	 * 
	 * @param jpaStyle jpaStyle=true时，参数形式为 ?0,?1,?2 jpaStyle=false时，参数形式为?,?,?
	 */
	public SqlParamPlaceholder(boolean jpaStyle, int paramIndex) {
		this.jpaStyle = jpaStyle;
		currIndex = paramIndex;
	}

	public String getNextPlaceholder() {
		if(jpaStyle) {
			String  placeholder = " ?" + currIndex++;
			return placeholder;
		}else {
			return " ?";
		}
	}
	
	public int getCurrIndex() {
		return currIndex;
	}
	
	
}
